﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.IO.IsolatedStorage;

namespace TheOliver.DigitalSignage.Client.Controls
{
    public partial class IsolatedStorageQuotaWindow : ChildWindow
    {
        long _newQuota;
        IsolatedStorageFile _file;

        public IsolatedStorageQuotaWindow(long newQuota, IsolatedStorageFile file)
        {
            InitializeComponent();
            _newQuota = newQuota;
            _file = file;
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            var storage = IsolatedStorageFile.GetUserStoreForApplication(); 
            var result = storage.IncreaseQuotaTo(_newQuota);
            if (result)
            {
                this.DialogResult = true;
            }
            else
            {
                this.DialogResult = false;
            }
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}

